package com.xcf.service.business.common.cost.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.xcf.dao.DaoSupport;
import com.xcf.entity.Page;
import com.xcf.service.business.common.cost.CostService;
import com.xcf.util.PageData;
@Service("CostServiceImpl")
public class CostServiceImpl implements CostService{
	@Resource(name="daoSupport")
	private  DaoSupport daosuport;
	@SuppressWarnings("unchecked")
	@Override
	//条件查询及列表
	public List<PageData> seach(PageData pd) throws Exception {	
		return (List<PageData>)daosuport.findForList("CostMapper.seach",pd);
	}
	//新增一条
	@Override
	public void addcost(PageData pd) {
		try {
			daosuport.save("CostMapper.save", pd);
		} catch (Exception e) {
			
			e.printStackTrace();
		}
		
	}
	
	//修改保存按钮
	@Override
	public void savaU(PageData pd) {
		try {
			daosuport.update("CostMapper.editU", pd);
		} catch (Exception e) {
			
			e.printStackTrace();
		}
		
	} 
	//删除
	@Override
	public void delete(PageData pd) {
		try {
			daosuport.delete("CostMapper.deleteU", pd);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
	//查询开票费用下拉
	@Override
	public List<PageData> ser(PageData pd) throws Exception {
	
		return (List<PageData>) daosuport.findForList("CostMapper.ser", pd);
	}

}
